Transfer track format information for tracks in cache at a primary storage system to a secondary storage system to which tracks are mirrored to use after a failover or failback

ABSTRACT

Provided are a computer program product, system, and method to transfer track format information for tracks in cache at a primary storage system to a secondary storage system to which tracks are mirrored to use after a failover or failback. In response to a failover from the primary storage system to the secondary storage system, the primary storage system adds a track identifier of the track and track format information indicating a layout of data in the track, indicated in track metadata for the track in the primary storage, to a cache transfer list. The primary storage system transfers the cache transfer list to the secondary storage system to use the track format information in the cache transfer list for a track staged into the secondary cache having a track identifier in the cache transfer list.

BACKGROUND OF THE INVENTION 1. Field of the Invention

Provided are a computer program product, system, and method to transfer track format information for tracks in cache at a primary storage system to a secondary storage system to which tracks are mirrored to use after a failover or failback.

2. Description of the Related Art

In a storage environment, a host system may communicate a read/write request to a connected storage system over network channel through a network adaptor. If the data is in a cache of the storage system, i.e., a read hit, then the data may be returned quickly to the host system. This reduces the delay in returning requested data to a host I/O request. However, if the requested data is not in the cache of the storage system, then there may be significant latency realized while the storage system needs to retrieve the requested data from storage to return. Further, the thread or task executing the host read request may have to be context switched and deactivated in order to allow the host system to process further I/O requests. When the data is returned to the read request, then the task must be reactivated and data for the task must be returned to registers and processor cache to allow processing of the returned data for the read request.

In a data mirroring storage environment, a primary storage system mirrors data to a secondary storage system. In certain situations, the primary storage system may be taken offline. In such case, a failover may occur from the primary storage system to the secondary storage system to handle I/O requests to the mirrored data. After the primary storage system becomes available, a failback may occur to redirect I/O requests back to the primary storage system. One example of a failover program is the International Business Machines Corporation's (“IBM”) HyperSwap® which is a function in the z/OS® operating system, that provides continuous availability by maintaining the mirror copy relationships to provide synchronous copies of source (primary) volumes in one or more storage systems to one or more target (secondary) volumes in one or more storage systems. (HyperSwap is a registered trademark of IBM in countries throughout the world).

There is a need in the art for improved techniques for processing host read/write requests to the cache in a mirrored storage environment in which failover and failback occur between a primary and secondary storage systems.

SUMMARY

Provided are a computer program product, system, and method to transfer track format information for tracks in cache at a primary storage system to a secondary storage system to which tracks are mirrored to use after a failover or failback. Data is mirrored from the primary storage system to the secondary storage system. A failover is initiated from the primary storage system to the secondary storage system. In response to the failover, for each track indicated in a cache list of tracks in the primary cache, the primary storage system adds a track identifier of the track and track format information indicating a layout of data in the track, indicated in track metadata for the track in the primary storage, to a cache transfer list. The primary storage system transfers the cache transfer list to the secondary storage system to use the track format information in the cache transfer list for a track staged into the secondary cache having a track identifier in the cache transfer list.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 illustrates an embodiment of a storage environment.

FIG. 2 illustrates an embodiment of a track format table entry.

FIG. 3 illustrates an embodiment of a cache control block.

FIG. 4 illustrates an embodiment of a cache Least Recently Used (LRU) list of tracks in the cache.

FIG. 5 illustrates an embodiment of a demoted cache Least Recently Used (LRU) list of tracks demoted from the cache.

FIG. 6 illustrates an embodiment of a demoted cache control block.

FIG. 7 illustrates an embodiment of a demoted cache control block directory entry.

FIG. 8 illustrates an embodiment of operations to process a read/write request received on a first channel, such as a bus interface.

FIG. 9 illustrates receive an embodiment of operations to process a read/write request received on a second channel, such as a network.

FIGS. 10a, 10b, and 10c illustrate an embodiment of operations to stage a track into the cache.

FIG. 11 illustrates an embodiment of operations to close track metadata and determine a track format code for the track in cache of the closed track metadata.

FIG. 12 illustrates an embodiment of a storage environment in which a primary storage system mirrors data to a secondary storage system.

FIG. 13 illustrates an embodiment of an entry in a cache transfer list.

FIG. 14 illustrates an embodiment of operations to initiate a failover from a primary storage system to a secondary storage system.

FIG. 15 illustrates an embodiment of operations at the secondary storage system to which failover is occurring to perform the failover.

FIG. 16 illustrates an embodiment of operations at the secondary storage system to failback to the primary storage system from which the failover occurred.

FIG. 17 illustrates an embodiment of operations to transfer track format information from an active storage system to the other storage system

FIG. 18 illustrates an embodiment of a computer architecture used with described embodiments.

DETAILED DESCRIPTION

In a storage environment, a host system may first communicate a read/write request to a connected storage system over a fast channel, such as a bus interface, such as the Peripheral Component Interconnect Express (PCIe) interface. For a read/write request over the fast channel which is supposed to complete within a threshold time, the host system holds the application thread for the read/write request in a spin loop waiting for the request to complete. This saves processor time associated with a context swap, which deactivates the thread and reactivates the thread in response to an interrupt when a response to the read/write request is received. If the data for the read/write request sent on the fast channel is not in cache, then the storage system may fail the read/write request and the host system may communicate the same read/write request over a storage area network via a host adaptor, which is slower than processing the I/O request over the bus, e.g., PCIe interface. Communicating the read/write request over the second channel requires the host system to perform context switch from the task handling the read/write request to another task while waiting for the read/write request to complete. Context switching is costly because it requires the processor running the task to clear all registers and L1 and L2 caches for the new task, and then when completing the new task, reactivate the context switched task and return the state data to the registers and L1 and L2 caches for the task that was context switched while waiting for the read/write request to complete.

Certain read/write operations need to be completed within a threshold time, else they are failed. The storage system will have to access track metadata to process a request to a track. The track metadata provides information on the format of data and layout of records in the track that are needed in order to perform reads and writes to the track. However, the reading of the track metadata from the storage comprises a substantial portion of the latency in processing read/write request. Described embodiments provide improvements to cache technology that reduce cache operation latency by including a track format code in the cache control block for a track in the cache. This track format code may be used for fast access to the track format from a track format table without having to read the track metadata from storage. By eliminating the need to read the track metadata from a metadata track in storage to determine the track layout, described embodiments increase the likelihood that read/write requests on the first channel that need to be completed within a threshold time are completed by accessing the track layout information for a track from the track format table, associating track format codes with track format information for common track formats.

Described embodiments provide further improvements to cache computer technology by reducing cache latency for a track staged into cache that was previously demoted by saving track format metadata, such as the track format code, when a track is demoted from the cache. When the demoted track is later staged into cache, the track format metadata may be quickly determined by the track format information saved with the demoted track and included in a cache control block for the staged track without having to read the metadata for the staged track. Avoiding the need to read the track metadata for a staged track substantially reduces the latency and delays in staging a track and processing a read/write request to the staged track.

With described embodiments, a read/write request to a target track on a channel requiring that the request be completed within a threshold time is processed if the track format code for the target track is within the cache control block for the target track. Using the track format code to access the track format metadata from the track format table reduces the latency of access to the track format metadata to allow the read/write request to complete within the time threshold. This keeps the time the host thread is spinning on the read/write request task for the read/write request sent on the bus interface within an acceptable time threshold. However, if the cache control block for the target track does not have a valid track format code, then the read/write request on the first channel is failed because it is unlikely the read/write request can complete within the threshold time given that the track format metadata will have to be retrieved from the storage. Failing the read/write request on the first channel, causes the host to redrive the read/write request on the second channel. The processing of the read/write request on the second channel reads in the track metadata from the storage to allow for processing the read/write request and adding the track format code to the cache control block for the target track.

In a mirror copy storage environment having a primary storage system and a secondary storage system, a failover may occur from the primary storage system to the secondary storage system. In the prior art when this occurred, after failover, data for tracks subject to I/O requests redirected to the secondary storage system to which failover occurred would not be in cache, and the secondary storage system would have to read the track metadata for requested tracks in order to determine the track format and layout to use to service the I/O request to the tracks in the cache. Described embodiments reduce the latency of I/O requests redirected to a secondary storage system after failover occurred by having the primary storage system that is failing-over transfer track format information of tracks in the cache at the primary storage system as part of the failover to the secondary storage system. The secondary system may maintain this transferred track format information for tracks in its cache, such as track format codes, to use for subsequent I/O requests to the tracks after the failover. In this way, when subsequent requests are received after failover to the secondary storage system, the secondary storage system may use the track format information transferred over from the primary storage system to determine the track format and layout without having to read track metadata from the storage at the secondary storage system. This substantially reduces latency in processing I/O requests after failover by avoiding the need to read the track metadata. Further, because the track format information is transferred for those tracks that were in the cache of the primary storage system failing-over, there is a high probability that there will be further requests to those tracks in the cache at the secondary storage system after the failover. This means that the latency reduction benefits of transferring the track format information will likely be realized at the secondary storage system for multiple I/O requests after failover.

FIG. 1 illustrates an embodiment of a storage environment in which a host 100 directs read and write requests to a storage system 102 to access tracks in volumes configured in storage devices 104 in a disk enclosure 106. The host 100 includes a processor complex 108 of one or more processor devices and a memory 110 including an operating system 111 executed by the processor complex 108. The host operating system 111 generates read and write requests to tracks configured in the storage devices 104. The host 100 includes hardware to communicate read and write requests on two different channels. A first channel is a bus interface, such as a Peripheral Component Interconnect Express (PCIe), including a bus 112, a bus switch 114 to connect one or more devices on the bus 112, including the processor complex 108, a memory system 110, and a bus host adaptor 116 to extend the bus interface over an external bus interface cable 118 to the storage system 102. Additional bus interface technology to extend the bus interface may be utilized, including PCIe extender cables or components, such as a distributed PCIe switch, to allow PCIe over Ethernet, such as with the ExpEther technology. A second channel to connect the host 100 and storage system 102 uses a network host adaptor 120, connected to the bus 112, that connects to a separate network 122 over which the host 100 and storage system 102 additionally communicate. The first channel through the bus interface may comprise a faster access channel than the network 122 interface through the network host adaptor 120.

The storage system 102 includes a bus interface comprising a bus 124 a, 124 b, a bus switch 126 to connect to endpoint devices on the bus 124 a, 124 b, and a bus host adaptor 128 to connect to the external bus interface cable 118 to allow communication over the bus interface to the host 100 over the first channel. The storage system 102 includes an Input/Output bay 130 having the bus host adaptor 128, one or more device adaptors 132 to connect to the storage devices 104, and one or more network host adaptors 134 to connect to the network 122 and host systems.

The storage system 102 includes a processor complex 136 of one or more processor devices and a memory 138 having a cache 140 to cache tracks accessed by the connected hosts 100. The memory 138 includes a cache manager 142 and a storage manager 144. The storage manager 144 manages access requests from processes in the hosts 100 and storage system 102 for tracks in the storage 104. The devices 136, 138, 128, 132, and 134 connect over the bus interface implemented in the bus lanes 124 a, 124 b and bus switch 126.

The cache manager 142 maintains accessed tracks in the cache 140 for future read access to the tracks to allow the accessed tracks to be returned from the faster access cache 140 instead of having to retrieve from the storage 104. Further, tracks in the cache 140 may be updated by writes. A track may comprise any unit of data configured in the storage 104, such as a track, Logical Block Address (LBA), etc., which is part of a larger grouping of tracks, such as a volume, logical device, etc.

The cache manager 142 maintains cache management information 146 in the memory 138 to manage read (unmodified) and write (modified) tracks in the cache 140. The cache management information 146 may include a track format table 200 having track format codes for common track format descriptors providing details of a layout and format of data in a track; track index 148 providing an index of tracks in the cache 140 to cache control blocks in a control block directory 300; and a Least Recently Used (LRU) list 400 for tracks in the cache 140. The control block directory 300 includes the cache control blocks, where there is one cache control block for each track in the cache 140 providing metadata on the track in the cache 140. The track index 148 associates tracks with the cache control blocks providing information on the tracks in the cache 140. Upon determining that the cache LRU list 400 is full or has reached a threshold level, tracks are demoted from the LRU list 400 to make room for more tracks to stage into the cache 140 from the storage 104.

In certain embodiments, there may be multiple hosts 100 that connect to the storage system 102 over the first and second channels to access tracks in the storage devices 104. In such case, the storage system 102 would have at least one bus host adaptor 128 to connect to the bus interface 118 of each connected host 100 and one or more network host adaptors 134 to connect to the network host adaptors 120 on the hosts 100.

In one embodiment, the bus interfaces 112, 114, 116, 118, 124 a, 124 b, 126, and 128 may comprise a Peripheral Component Interconnect Express (PCIe) bus interface technology. In alternative embodiments, the bus interfaces 112, 114, 116, 118, 124 a, 124 b, 126, and 128 may utilize suitable bus interface technology other than PCIe. The bus host adaptors 116 and 128 may comprise PCIe host adaptors that provide the interface to connect to the PCIe cable 118. The network 122 may comprise a Storage Area Network (SAN), a Local Area Network (LAN), a Wide Area Network (WAN), the Internet, an Intranet, etc., and the network host adaptors 120, 134 provide the network 122 connections between the hosts 100 and storage system 102.

The storage system 102 may comprise a storage system, such as the International Business Machines Corporation (IBM®) DS8000® and DS8880 storage systems, or storage controllers and storage systems from other vendors. (IBM and DS8000 are trademarks of International Business Machines Corporation throughout the world). The host operating system 111 may comprise an operating system such as Z Systems Operating System (Z/OS®) from International Business Machines Corporation (“IBM”) or other operating systems known in the art. (Z/OS is a registered trademark of IBM throughout the world).

The storage devices 104 in the disk enclosure 106 may comprise different types or classes of storage devices, such as magnetic hard disk drives, solid state storage device (SSD) comprised of solid state electronics, EEPROM (Electrically Erasable Programmable Read-Only Memory), flash memory, flash disk, Random Access Memory (RAM) drive, storage-class memory (SCM), etc., Phase Change Memory (PCM), resistive random access memory (RRAM), spin transfer torque memory (STT-RAM), conductive bridging RAM (CBRAM), magnetic hard disk drive, optical disk, tape, etc. Volumes in a storage space may further be configured from an array of devices, such as Just a Bunch of Disks (JBOD), Direct Access Storage Device (DASD), Redundant Array of Independent Disks (RAID) array, virtualization device, etc. Further, the storage devices 104 in the disk enclosure 106 may comprise heterogeneous storage devices from different vendors and different types of storage devices, such as a first type of storage devices, e.g., hard disk drives, that have a slower data transfer rate than a second type of storage devices, e.g., SSDs.

FIG. 2 illustrates an embodiment of a track format table entry 200 _(i) in the track format table 200, which includes a track format code 202 and the track format metadata 204. In certain embodiments Count Key Data (CKD) track embodiments, the track format metadata 204 may comprise a track format descriptor (TFD) indicating a number of records in the track, a block size, a number of blocks in the track, a data length of each of the records, and a control interval size indicating an amount of data that is read or written atomically as a unit, number of blocks in a control interval, and whether a control interval spans two tracks, and other information. The track format code 202 may comprise an index value of the index entry 200 _(i) in the track format table 200. For instance, if there are 32 track format table entries 200 _(i), then the track format code 202 may comprise 5 bits to reference the different possible number of 32 entries 200 _(i).

FIG. 3 illustrates an embodiment of a cache control block 300 _(i) for one of the tracks in the cache 140, including, but not limited to, a cache control block identifier 302, such as an index value of the cache control block 300 _(i); a track ID 304 of the track in the storage 104; the cache LRU list 306 in which the cache control block 300 _(i) is indicated; an LRU list entry 308 at which the track is indicated; a cache timestamp 310 indicating a time the track was added to the cache 140 and indicated on the LRU list 306; additional track metadata 312 typically maintained for tracks stored in the cache 140, such as a dirty flag indicating whether the track was modified; a track format code 314 comprising one of the track format codes 202 of the track format metadata 204 describing the layout of data in the track 304 represented by the cache control block 300 _(i); a track format code valid flag 316 indicating whether the track format code 314 is valid or invalid; and an invalid reason 318 indicating a reason for the track format code valid flag 316 code being invalid, as indicated in the track format code valid flag 316.

FIG. 4 illustrates an embodiment of an LRU list 400—such as having a most recently used (MRU) end 402 identifying a track most recently added to the cache 140 or most recently accessed in the cache 140 and a least recently used (LRU) end 404 from which the track identified at the LRU end 404 is selected to demote from the cache 140. The MRU end 402 and LRU end 404 point to track identifiers, such as a track identifier address or a cache control block index for the track, of the tracks that have been most recently added and in the cache 140 the longest, respectively, for tracks indicated in that list 400.

FIG. 5 illustrates an embodiment of the demoted cache LRU list 500, having a most recently used (MRU) end 502 identifying a demoted track most recently added to the demoted cache LRU list 500 and a least recently used (LRU) end 504 from which the demoted track identified at the LRU end 504 is selected to demote from the demoted cache LRU list 500.

FIG. 6 illustrates an embodiment of a demoted cache control block 600 _(i) having a track identifier (ID) 602 of a demoted track; a track format code 604 if available of the track format metadata 204 in the track format table 200 of the demoted track; a pointer to a previous LRU entry 606 of a previous demoted track in the demoted cache LRU list 500; a pointer to a next LRU entry 608 of a next demoted track in the demoted cache LRU list 500; and a pointer 610 to next demoted cache control block in the entry in the demoted cache control block directory 700 for the track ID 602.

In additional embodiments, the track format code 604 may comprise track format information other than a code 604 in a track format table 200, such as other information that may be used to identify or represent the track format metadata and layout of data in the tracks and comprises substantially less bits of information than the represented track format metadata and layout information.

FIG. 7 illustrates an embodiment of an entry 700 _(i) in the demoted cache control block directory 700 that includes pointers 702 ₁, 702 ₂ . . . 702 _(n) to demoted cache control blocks 600 _(i). Each demoted cache control block 600 _(i) maps to one entry in the demoted cache control block directory 700 based on the track ID 602. In one embodiment, a hash function of the track identifier would produce the entry in the demoted cache control block directory 700 in which the demoted cache control block 600 _(i) is indicated.

FIG. 8 illustrates an embodiment of operations performed by the cache manager 142 and storage manager 144 to process a read/write request to a target track received on a first fast channel, such as the PCIe bus interface via bus host adaptor 128. Upon receiving (at block 800) the read/write request at the bus host adaptor 128, if (at block 802) the target track is not in the cache 140, then the storage manager 144 returns (at block 804) fail to the read/write request on the first channel or bus host adaptor 128 to the host 100, which causes the host 100 to retry the read/write request on the second channel or network host adaptor 120, 134. Failure is returned because if the target track is not in the cache 140, then the target track and track metadata needs to be staged into cache 140, which would likely exceed the time threshold for read/writes on the first channel, where the host processor is spinning on the thread of the read/write request. If (at block 802) the target track is in the cache 140 is a write and if (at block 808) the write modifies the track format, then the cache manager 142 sets (at block 810) the track format code valid flag 316 to invalid and indicates (at block 812) the invalid reason 318 that the track in the cache 140 was invalidated as track format change. The storage manager 144 then returns (at block 804) fail to the host 100 because the track metadata needs to be read from the storage 104 to update with the modified track format.

If (at block 806) the read/write request is a read or if (at block 808) the request is a write that does not modify the track format, then the cache manager 142 determines (at block 814) if the track format code valid flag 316 is set to valid. If so, then the cache manager 142 determines (at block 816) the track format metadata 204 in the track format table 200 corresponding to the track format code 314 in the cache control block 300 _(i). The cache manager 142 uses (at block 818) the track format layout indicated in the determined track format metadata 204 to process the read or write request to the target track in the cache 140. If the request is a write, a dirty flag 312 in the cache control block 300 _(i) may be set to indicate the track is modified. If (at block 814) the track format code valid flag 316 is invalid, meaning there is no fast access to track formation information available through the track format code 314, then the storage manager 144 returns (at block 804) fail on the bus interface to the bus host adaptor 128 because the track format table 200 cannot be used, and the track metadata needs to be read from the storage 104, which would introduce too much latency for the fast read/write on the first channel.

With the embodiment of operations of FIG. 8, during a fast write over the bus interface or first channel, if the track format metadata may be accessed without latency through the track format table 200, then the read/write request is allowed to proceed when the transaction can be processed very quickly because the track metadata can be obtained directly from the track format table 200 through the track format code 314, without having to read the track metadata from storage 104. However, if the cache control block 300 _(i) does not have a valid track format code 314 to allow low latency access of track format metadata, then the read/write request is failed because the transaction will not likely complete within a fast time threshold. This determination is important to avoid host delays in processing other tasks while the host processor is spinning on the thread handling the read/write request while waiting for the read/write request to complete. If the track metadata can be accessed from the track format table 200 than there is a high likelihood the read/write can complete on the bus interface channel within the time required to avoid the host processor holding the thread for too long, which causes other I/O requests to be queued and delayed. If the track metadata cannot be accessed from the track format table 200 and needs to be read from the storage 104, then it is unlikely the read/write request will complete within the time threshold for the host processor to spin on the thread for the read/write request, and failure is returned. Returning failure when the track metadata cannot be obtained from the track format table 200 causes the host thread waiting on the read/write request task to be deactivated and the host processor may context switch to processing other tasks, and then the read/write request is retried on the second network channel during the context switch.

FIG. 9 illustrates an embodiment of operations performed by the cache manager 142 and storage manager 144 to process a read/write request to a target track received on a second channel, such as the network 122 on network host adaptor 134. Upon receiving (at block 900) the read/write request, if (at block 902) the target track is not in the cache 140, then the cache manager 142 proceeds (at block 904) to block 1000 in FIG. 10a to stage the track into the cache 140. If (at block 908) the read/write request is a write and if (at block 910) the write modifies the track format, then the cache manager 142 updates (at block 912) the track metadata to indicate the modified track format and sets (at block 914) the track format code valid flag 316 to invalid. The track metadata 312 is further updated (at block 916) to indicate the track is modified or dirty. If (at block 908) the request is a read or from block 916, the cache manager 142 uses (at block 918) the track format layout indicated in the track format metadata to process the read or write request to the target track in the cache 140.

If (at block 902) the target track is in the cache 140 and if (at block 930) the track format code valid flag 316 is set to valid, then the cache manager 142 determines (at block 932) the track format metadata 204 in the track format table 200 corresponding to the track format code 314 in the cache control block 300 _(i) for the target track. From block 932, control proceeds to block 908 to process the read/write request. If (at block 930) the track format code valid flag 316 is set to invalid, then the cache manager 142 reads (at block 934) the track metadata for the target track from the storage 104 to determine the track format, e.g., size of blocks, control interval, layout of records on the track, etc. From block 934, control proceeds to block 908 to process the read/write request.

With the embodiment of FIG. 9, when the read/write request is received on the second slower channel, such as over the network 122, where the host operating system 111 would have performed a context switch for the thread handling the read/write request, the cache manager 142 may read the track metadata from the storage 104 to determine the track layout to process the request. During this time, the host processing of further host requests is not delayed because the host thread handling the read/write request is context switched and not active, until the read/write request returns complete.

FIGS. 10a, 10b, and 10c illustrate an embodiment of operations performed by the cache manager 142 to stage a track into the cache 140, which may be invoked at block 904 in FIG. 9 when the target track of a read/write request is not in the cache 140. Upon initiating (at block 1000) the operation to stage a track into the cache 140, if (at block 1002) the cache LRU list 400 is full, then the track at the LRU end 404 of the cache LRU list 400 is selected (at block 1004) to demote. If (at block 1006) the demoted cache LRU list 500 is full, then the cache manager 142 selects (at block 1008) a demoted track indicated at the LRU end 504 of the demoted cache LRU list 500 to demote. The selected demoted track is removed (at block 1010) from the LRU end 504. The cache manager 142 adjusts (at block 1012) a demoted cache control block 600 _(j) whose pointer to next LRU entry 608 points to the selected demoted track in the demoted cache LRU list 500 to indicate that the pointer 608 is null, because now that entry is at the LRU end 504 when the selected demoted track is removed from the demoted cache LRU list 500.

The cache manager 142 determines (at block 1014) an entry 700 _(i) in the demoted cache control block directory 700 having the demoted cache control block 600 _(S) of the selected demoted track. In one embodiment, the entry 700 _(i) may be determined by applying a hash function to the selected demoted track identifier. The hash function may map any of the track identifiers in the storage 104 to one of the entries 700 _(i) in the demoted cache control block directory 700. The cache manager 142 then needs to adjust the pointer 610 that points to the demoted cache control block 600 _(S) of the selected demoted track. For this, the cache manager 142 adjusts (at block 1016) a demoted cache control block 600 _(j) in the determined entry 700 _(i) that points to the demoted cache control block 600 _(S) of the selected demoted track to point to the demoted cache control block 600 _(k) pointed to by the pointer 610 of the demoted cache control block 600 _(S) of the selected demoted track. The demoted cache control block 600 _(S) for the selected demoted track is deleted (at block 1018) and indication of the deleted demoted cache control block 600 _(S) is removed (at block 1020) from the entry 700 _(i) in the demoted cache control block directory 700.

From block 1020 or if (at block 1006) the demoted cache LRU list 500 is not full, control proceeds (at block 1022) to block 1030 in FIG. 10b to add the demoted track from the cache 140 to the demoted cache LRU list 500. Upon initiating (at block 1030) the operation to add the demoted track to the demoted cache LRU list 500, the cache manager 142 indicates (at block 1032) the demoted track at the MRU end 502 of the demoted cache LRU list 500. The cache manager 142 determines (at block 1034) the cache control block 300 _(DT) for the demoted track from the cache 140 and the track format code 314 for the demoted track if one is included. The cache manager 142 generates (at block 1036) a demoted track cache control block 600 _(DT) for the track being demoted indicating a track identifier 602 of the demoted track and the determined track format code 314 for the demoted track to save the track format code in field 604 of the demoted track cache control block 600 _(DT). If there was no valid track format code 314 in the cache control block 300 _(DT), then a null value may be indicated in the field 604 indicating there is no valid track format code for the demoted track.

The cache manager 142 determines (at block 1038) the entry 700 _(i) in the demoted cache control block directory 700 that will be used to indicate the demoted cache control block 600 _(DT) of the demoted track. The next pointer 610 of the last demoted cache control block 600 _(i) indicated in the determined entry 700 _(i) is adjusted (at block 1040) to point to the demoted cache control block 600 _(DT) for the track being demoted. The demoted track control block 600 _(DT) for the demoted track is indicated (at block 1042) in the determined entry 700 ₁ in the demoted cache control block directory 700, e.g., at the end of the entry 700 _(i). After adding the demoted track to the demoted LRU list 500 and the demoted cache control block 600 _(DT) to the demoted cache control block directory 700, control proceeds (at block 1044) to block 1060 in FIG. 10c to stage the target track to the cache 140. Control also proceeds to block 1060 in FIG. 10c to stage the track if (at block 1002 in FIG. 10a ) the cache LRU list 400 is not full, so that a track does not need to be demoted from the cache 140 and added to the demoted cache LRU list 500.

Upon initiating (at block 1060) the operation to stage the track to the cache 140, the cache manager 142 stages (at block 1062) the target track into the cache 140 from the storage 104. The staging of the actual track data from the storage 104 may have been initiated earlier before or during the operations of FIGS. 10a, 10b to manage the demoted cache LRU list 500 and demoted cache control block directory 700. The target track staged into the cache 140 is indicated (at block 1064) at the MRU end 402 of the cache LRU list 400. A cache control block 300 _(ST) is generated (at block 1066) for the staged track. Control then proceeds to block 1068 to determine if there is a demoted cache control block 600 _(ST) for the staged track that has a track format code 604 (or other track format information) that can be included in the cache control block 300 _(ST) created for the staged track. A determination is made (at block 1068) of the entry 700 _(i) in the demoted cache control block directory 700 that could have a demoted cache control block 600 _(ST) for the staged track, which entry 700 _(i) may be determined by applying a hash function to the track identifier of the staged track. The first demoted cache control block 600 _(SEL) in the determined entry 700 _(i) is selected (at block 1070). If (at block 1072) the track identifier 602 of the selected demoted cache control block 600 _(SEL) matches the track identifier of the staged track, then the track format code 604 in the selected demoted cache control block 600 _(SEL) is included (at block 1074) in the cache control block 300 _(ST) for the staged track. The cache manager 142 may then perform (at block 1076) the operations at blocks 1010, 1016, 1018, and 1020 in FIG. 10a to remove demoted track information for the staged track, including removing the demoted cache control block 600 _(ST) for the staged track, removing the staged track from the demoted cache LRU list 500, removing the indication of the demoted cache control block 600 _(ST) from the demoted cache control block directory 700, and adjusting pointers 606, 608, 610 in other demoted cache control blocks 600 _(i) that pointed to the demoted track or demoted cache control block 600 _(ST) for the staged track because the staged track is no longer demoted but active in cache 140.

If (at block 1072) the selected demoted cache control block 600 _(SEL) is not for the staged track and if (at block 1078) there is a next demoted cache control block 600 _(i) in the entry 700 _(i), which may be indicated in the pointer 610, then that next demoted cache control block is selected (at block 1080) and control returns to block 1070 to determine whether this next demoted cache control block 600 _(i) is for the staged track. If (at block 1078) there are no further next demoted cache control blocks in the determined entry 700 _(i) to consider, then the track format code 202 from a demoted track information cannot be used and the cache manager 142 reads (at block 1082) the metadata for the track from the storage 104 to determine the track format. From block 1076 after using the track format code 604 from the demoted cache control block for the staged track or after reading (at block 1082) the metadata for the staged track, control returns (at block 1084) to block 904 in FIG. 9 with staging complete to perform the read/write operation with respect to the staged track.

With the embodiments of FIGS. 10a, 10b, and 10c , the track format code for a track demoted from cache can be saved and later used when the demoted track is staged back into cache. This allows the track metadata format to be quickly determined for the demoted track staged back into cache without having to read the metadata for the track from storage. The computer performance for cache operations, particularly staging, are substantially improved and latency reduced by determining the track metadata format and layout of a track being staged into cache without having to read the metadata for the track.

FIG. 11 illustrates an embodiment of operations performed by the cache manager 142 when closing the track metadata for a track in the cache 140, which involves destaging the track metadata to the storage 104 if changed. Upon closing (at block 1100) the track metadata for a track in the cache 140, the cache manager 140 processes (at block 1102) the track metadata to determine a track format or a layout of data in the track. If (at block 1104) the track format table 200 does not have a track format 204 matching the determined track format from the track metadata, which may happen if the determined track format is irregular, then the track format code valid flag 316 is set (at block 1106) to invalid and the invalid reason 318 is set to indicate that the track format is not supported. In such situation, read/write requests to the track having an irregular format are only processed when received through the second channel via network host adaptor 134.

If (at block 1104) the track format table has a track format 204 matching the determined track format from the track metadata, then the cache manager 142 determines the track format code 202 for the determined track format 204 in the track format table 200 and includes the track format code 202 in the field 314 in the cache control block 300 _(i). The track format code valid flag 316 is set (at block 1116) to valid. From block 1108 or 1116, control proceeds to block 1118 to destage the track metadata from the memory 138 if modified or discard if not modified.

With the operations of FIG. 11, the track format information may be indicated in the cache control block 300 _(i) with a track format code 202 having a limited number of bits to index track format metadata 204 describing track layout in a track format table 200, where the track metadata itself would not fit into the cache control block 300 _(i). For future read/write accesses, if a valid track format code 314 is provided, then the cache manager 142 may use that code 314 to obtain with low latency the track format metadata 204 from the track format table 200 without having to read the track metadata from the storage 104 and process to determine the track format.

Storage Mirroring Environment

FIG. 12 illustrates an embodiment of the storage environment of FIG. 1 of a host 1200 having components 1208, 1210, 1211, 1212, 1214, 1216, 1220 that comprise the components 108, 110, 111, 112, 114, 116, 120 of the host 100 described with respect to FIG. 1. The embodiment of FIG. 12 additionally includes a primary storage system 1202 ₁ and a secondary storage system 1202 ₂, where each of the primary 1202 ₁ and secondary 1202 ₂ storage systems include the components of the storage system 102 as described with respect to FIG. 1. Further, the host 1200 may include one or more bus host adaptors 1216 having links 1218 ₁ and 1218 ₂ to the primary 1202 ₁ and secondary 1202 ₂ storage systems, where the links 1218 ₁ and 1218 ₂ may comprise a PCIe over Ethernet or network type link to extend the PCIe link over a network, such as an Ethernet network, such as the ExpEther technology. The hosts 1200 may also communicate with the primary 1202 ₁ and secondary 1202 ₂ storage systems over the network 1222 via network host adaptors 1220 and 134.

Each of the primary 1202 ₁ and secondary 1202 ₂ storage systems would include, as shown and described with respect to FIGS. 1-7, a processor complex 136 and the components in the memory 138, including components 140, 142, 144, 146, 148, 200, 300, 400, 500, 600, and 700. Further, each of the primary 1202 ₁ and secondary 1202 ₂ storage systems would be capable of performing the operations of FIGS. 8-9, 10 a, 10 b, 10 c, and 11 to manage their respective cache 140 and I/O requests directed thereto.

Each of the primary 1202 ₁ and secondary 1202 ₂ storage systems additionally include a cache transfer list 1300 ₁, 1300 ₂ that includes tracks and track format codes to transfer to the other system 1202 ₂, 1202 ₁ as part of a failover or failback operation; a replication manager 1252 ₁, 1252 ₂ to replicate data to the other system 1202 ₂, 1202 ₁; and a failover manager 1254 ₁, 1254 ₂ to manage failover and failback operations. The failover manager 1254 ₁, 1254 ₂ and replication manager 1252 ₁, 1252 ₂ may coordinate replication and failover/failback operations with the host 100.

The primary and secondary replication managers 1252 ₁, 1252 ₂ may create active copy relationships to manage the mirroring of data from the primary storage 104 ₁ to the secondary storage system storage 104 ₂ and vice versa.

The primary 1202 ₁ and secondary 1202 ₂ storage systems may each comprise an enterprise storage controller/server suitable for managing access to attached storage devices, such as, but not limited to, the International Business Machines Corporation's (“IBM”) DS8000® storage system or other vendor storage servers known in the art. (DS8000 is a registered trademark of IBM in countries throughout the world).

In one embodiment, the replication managers 1252 ₁, 1252 ₂ may comprises a program for managing the mirroring of volumes across systems, such as, but not limited to, the IBM mirroring programs Geographically Dispersed Parallel Sysplex® (GDPS)®, and Tivoli® Storage Productivity Center for Replication (TPC-R) that define a replication session and copy pairs. Different types of techniques may be selected to copy the data, such as synchronous mirroring, asynchronous mirroring or point-in-time copying, or combinations of multiple of these different mirroring types. The failover managers 1254 ₁, 1254 ₂ may comprise a program suitable for handling failover and failback operations, such as, but not limited to, the IBM HyperSwap product which establishes failover sessions from the established copy pairs. (Geographically Dispersed Parallel Sysplex, GDPS, Tivoli, and HyperSwap are registered trademarks of IBM in countries throughout the world).

During operations while both primary 1202 ₁ and secondary 1202 ₂ storage systems are operating, the bus host adaptor 1228 and network host adaptor 1234 would direct a received I/O request to the primary storage system 1202 ₁, and the replication manager 1252 ₁ of the primary storage system 1202 ₁ would mirror data at the primary storage 104 ₁ to the secondary storage system 1202 ₂.

FIG. 13 illustrates an embodiment of an entry 1300 _(i,j) in the cache transfer lists 1300 ₁, 1300 ₂, where entry j includes a track identifier (ID) 1302 and a track format code 1304 comprising one of the track format codes 202 in the track format table 202 indicating track format metadata 204 for the track 1302.

FIG. 14 illustrates an embodiment of operations performed by the failover manager 1254 ₁, 1254 ₂ (or other components such as the cache manager 142 and/or storage manager 144) in the primary 1202 ₁ or secondary 1202 ₂ storage system that is failing over to the other storage system 1202 ₂, 1202 ₁. FIGS. 14, 15, and 16 are described with respect to a failover from the primary storage system 1202 ₁ to the secondary storage system 1202 ₂, and then a failback from the secondary storage system 1202 ₂ to the primary storage system 1202 ₁. However, the operations may also apply with respect to a failover from the secondary storage system 1202 ₂ to the primary storage system 1202 ₁, and then a failback from the primary storage system 1202 ₁ to the secondary storage system 1202 ₂. Upon initiating (at block 1400) a failover, i.e., swap, from the primary storage system 1202 ₁ to the secondary storage system 1202 ₂, the failover manager 1254 ₁ quiesces (at block 1402) reads and writes to the primary storage system 1202 ₁. The bus 1228 and network 1234 host adaptors may quiesce the I/O requests in the adaptors 1228 and 1234. The modified data in the primary cache 140 ₁ at the primary storage system 1202 ₁ is destaged (at block 1404).

The failover manager 1254 ₁ proceeds to block 1406 to build the primary cache transfer list 1300 ₁. At block 1406, the failover manager 1254 ₁ selects (at block 1406) a track at the MRU end 402 of the cache LRU list 400 of the primary storage system 1202 ₁. and accesses (at block 1408) the cache control block 300 ₁ for the selected track in the cache control block directory 300 of the primary storage system 1202 ₁. If (at block 1410) the accessed cache control block 300 ₁ has a valid track format code 314, then an entry 1300 _(1,j) is added (at block 1412) to the primary cache transfer list 1300 ₁ having the track identifier of the selected track and the track format code 314 in the accessed cache control block 300 ₁ in fields 1302 and 1304, respectively. If (from the no branch of block 1410) there is no valid track format code 314 in the cache control block 300 ₁, such as if track format code valid flag 316 indicates invalid, or after adding (at block 1412) the entry 1300 _(i,j) to the first cache transfer list 1300 ₁, then a determination is made (at block 1414) if there are further tracks in the cache LRU list 400 to consider. If so, then a next track in the cache LRU list 400 is selected (at block 1416) and control proceeds back to block 1408 to determine whether to include an entry 1300 _(i,j) in the first cache transfer list 1300 ₁. If (at block 1414) there are no further entries in the cache LRU list 400 of primary storage system 1202 ₁, then the first cache transfer list 1300 ₁ is transmitted (at block 1418) to the secondary storage system 1202 ₂. The primary storage system 1202 ₁ may further transfer over (at block 1420) any modified data in the primary cache 140 ₁ of the primary storage system 1202 ₁ to the secondary storage system 1202 ₂. The failover manager 1241 ₁ performs a failover (at block 1422) to the secondary storage system 1202 ₂, e.g., swap so the host 1200 directs I/O requests to the secondary storage system 1202 ₂ after the failover.

The operations of FIG. 14 allow the storage system 1202 ₁, 1202 ₂ that will failover to generate a cache transfer list 1300 ₁, 1300 ₂ having information on the track format codes or track format information for tracks in the cache that may be provided to the storage system 1202 ₁, 1202 ₂ to which failover occurs. This allows for the storage system 1202 ₁, 1202 ₂ to which failover occurs from avoiding having to read the track metadata to process I/O requests to the tracks and instead use the track format metadata from the information provided in the cache transfer list 1300 ₁, 1300 ₂. This improves I/O processing performance in the active storage system 1202 ₁, 1202 ₂ after a failover by not having to read the track metadata in the storage to determine the track format and layout. Further, since the track format information in the cache transfer list 1300 ₁, 1300 ₂ is for tracks that were already in the cache 140 before the failover, these tracks are likely to be the subject of further accesses after the failover. Thus, the benefits of the reductions in latency are likely to be realized in future cache accesses at the storage system 1202 ₁, 1202 ₂ active after failover.

With the described operations of FIG. 14, the track format information indicated in the cache transfer list 1300 ₁, 1300 ₂ may be for tracks that are modified and not modified, i.e., tracks staged in for read access. In this way, the active storage system after the failover does not have to read the track metadata to determine the track format information when staging requested tracks in the cache 140 for read or write access.

FIG. 15 illustrates an embodiment of operations performed at the failover manager 1254 ₂ in the secondary storage system 1202 ₂ to which failover occurred according to the operations of FIG. 14. The secondary storage system 1202 ₂ receives (at block 1500) the first cache transfer list 1300 ₁ for failover. The failover manager 1254 ₂ may then add (at block 1504) track identifiers 1302 in the received primary cache transfer list 1300 ₁ to the demoted cache LRU list 500 in the secondary storage system 1202 ₂. In one embodiment, all the track identifiers 1302 in the first cache transfer list 1300 ₁ may be added to the demoted cache LRU list 500 in the secondary storage system 1202 ₂. In an alternative embodiment, if there is not enough room in the demoted cache LRU list 500 for all the track identifiers 1302 in the first cache transfer list 1300 ₁, then only a portion of the track identifiers 1302 in the first cache transfer list 1300 ₁ may be added. In a further embodiment, some entries may be removed from the demoted cache LRU list 500 to make room for entries from the cache transfer list 1300 ₁. In certain embodiments, entries from the existing cache LRU list 500 and the cache transfer list 1300 ₁ may be merged and added based on a timestamp of the last access, so that the most recently accessed tracks indicated in both lists 500 and 1300 ₁ are included in the cache LRU list 500.

For each track i in the received first cache transfer list 1300 ₁ included in the demoted cache LRU list 500, the failover manager 1254 ₂ (or cache manager 142 at the second processing node 1250 ₂) may perform (at block 1504) the operations at blocks 1036, 1038, 1040, 1042 in FIG. 10b to add demoted cache control blocks 600 _(i) and indicate in the entry 700 _(i) of the demoted cache control block directory 700 for the track i. The failover manager 1254 ₂ ends (at block 1506) the quiescing of read and write requests to the first storage areas and redirect the host 1200 to the secondary storage system 1202 ₂. The failover manager 1254 ₂ acknowledges (at block 1508) to the host 1200 and primary storage system 1202 ₁ that the failover completed.

With the operations of FIG. 15, the secondary storage system 1202 ₂ incorporates the track format metadata of tracks that were in the cache 140, of the primary storage system 1202 ₁ at the time of the failover into the demote cache control blocks 300 at the secondary storage system 1202 ₂ to be available to use for tracks staged into the cache 140 ₂ at the secondary storage system 1202 ₂ to improve latency by being able to determine the track format metadata from the cache control blocks 300 instead of having to read track metadata from the storage 1206 to determine the track format layout. The benefits of improved latency are likely to be realized because the connected hosts 1200 are likely to continue accessing tracks that were in the primary storage system 1202 ₁ before the failover after the failover is performed. With the described embodiments, the track format data provided in the primary cache transfer list 1300 ₁ improves the latency of operations at the secondary storage system 1202 ₂ by making the track metadata information available to the secondary storage system 1202 ₂ so that the secondary storage system 1202 ₂ does not need to read the track metadata from storage to access.

FIG. 16 illustrates an embodiment of operations performed at the failover manager 1254 ₁, 1254 ₂ of the active storage system 1202 ₁, 1202 ₂ to which failover occurred to failback to the other storage system 1202 ₂, 1202 ₁, from which failover occurred. Upon initiating (at block 1600) a failback from the secondary storage system 1202 ₂ back to the primary storage system 1202 _(i), the failover manager 1254 ₂ quiesces (at block 1602) read and writes to the secondary storage system 1202 ₂. The bus 1228 and network 1234 host adaptors may quiesce the I/O requests in the adaptors 1228 and 1234. Modified data in the secondary cache 140 ₂ at the secondary storage system 1202 ₂ is destaged (at block 1604). The failover manager 1254 ₂ proceeds to block 1608 to build a second cache transfer list 1300 ₂.

At block 1608, the failover manager 1254 ₂ selects a first track from the MRU end 402 of the cache LRU list 400 of the secondary storage system 1202 ₂ and accesses (at block 1610) the cache control block 300 ₁ for the selected track in the cache control block directory 300 of the secondary storage system 1202 ₂. If (at block 1612) the accessed cache control block 300 ₁ has a valid track format code 314 for a track in the first storage area, then an entry 1300 ₂, is added to the second cache transfer list 1300 ₂ having the track identifier of the selected track and the track format code 314 in the accessed cache control block 300 ₁ in fields 1302 and 1304, respectively. If (from the no branch of block 1612) there is no valid track format code 314 in the cache control block 300 ₁, such as if track format code valid flag 316 indicates invalid, or after adding the entry 1300 _(2j) to the second cache transfer list 1300 ₂, then a determination is made (at block 1616) as to whether there are further tracks in the cache LRU list 400 at the secondary storage system 1202 ₂ to consider. If so, then a next track in the cache LRU list 400 at the secondary storage system 1202 ₂ is selected (at block 1618) and control proceeds back to block 1610 to determine whether to include a further entry 1300 _(2j) in the second cache transfer list 1300 ₂. If (at block 1616) there are no further entries in the cache LRU list 400 of the secondary storage system 1202 ₂, then the second cache transfer list 1300 ₂ is transmitted (at block 1620) to the primary storage system 1202 ₁. The failover manager 1254 ₂ may further transfer over (at block 1622) any modified tracks in the secondary cache 140 ₂ not yet transferred to the primary storage system 1202 ₁. Failback complete may then be returned (at block 1622) to the primary storage system 1202 ₁.

With the operations of FIG. 16, the storage system 1202 ₁, 1202 ₂ that is performing a failback to the system from which failover previously occurred generates a cache transfer list 1300 ₁, 1300 ₂ having information on the track format codes or track format information for tracks in the cache 140 for the first storage areas to reassign back. This allows the primary storage system 1202 ₁, to which failback occurs, to avoid having to read track metadata from the storage 1206 after the failback because the track format and layout may be obtained from the track format information provided in the transmitted cache transfer list 1300 ₂ of the track format information of tracks in the cache at the secondary storage system 1202 ₂ when the failback occurred. This improves I/O processing performance in the storage system to which operations are restored during a failback because the storage system brought back online does not have to read the track metadata in the storage to determine the track format metadata for accesses to tracks that were previously in the secondary storage system 1202 ₂ prior to the failback. Further, since the track format metadata in the cache transfer list 1300 ₂ is for tracks that were already in the cache 140 before the failback, these tracks are likely to be the subject of further accesses after the failback. Thus, the benefits of the reductions in latency are likely to be realized in future cache accesses at the storage system to which functionality is restored as a result of the failback.

With the described operations of FIG. 16, the track format information indicated in the cache transfer list 1300 ₁, 1300 ₂ may be for tracks that are modified and not modified, i.e., tracks staged in for read access. In this way, the active storage system after the failback does not have to read the track metadata to determine the track format information when staging requested tracks in the cache 140 for read or write access.

FIG. 17 illustrates an embodiment of operations performed at the active storage system 1202 ₁, 1202 ₂, before and after a failover and failback, to transfer the cache access list 1300 ₁, 1300 ₂ of track format information during operations to make available at the storage system to which failover occurs. Upon initiating (at block 1700) operations to transfer track format information, the active storage system 1202 ₁, 1202 ₂ determines (at block 1702) tracks in the cache 140 at the active storage system 1202 ₁, 1202 ₂ and performs the operations at blocks 1406-1418 in FIG. 14 to generate and transfer to the inactive storage system a cache transfer list 1300 ₁, 1300 ₂ for the tracks in the cache including the track identifiers and the track format information for the tracks in the cache 140.

The operations of FIG. 17 may be performed while mirroring tracks from the active storage system to the non-active storage system, such that the cache transfer list would include tracks being mirrored as well as unmodified tracks that would not be mirrored. In further embodiments, the cache transfer list may be periodically generated and transferred during periods of low activity and usage at the active storage system. In this way, at the time of failover, the track format information would only need to be included in the cache transfer list for those tracks added to the cache since the last cache transfer list was generated during normal operations of the active storage system before the failover or failback operation.

The present invention may be implemented as a system, a method, and/or a computer program product. The computer program product may include a computer readable storage medium (or media) having computer readable program instructions thereon for causing a processor to carry out aspects of the present invention.

The computer readable storage medium can be a tangible device that can retain and store instructions for use by an instruction execution device. The computer readable storage medium may be, for example, but is not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. A non-exhaustive list of more specific examples of the computer readable storage medium includes the following: a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanically encoded device such as punch-cards or raised structures in a groove having instructions recorded thereon, and any suitable combination of the foregoing. A computer readable storage medium, as used herein, is not to be construed as being transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission media (e.g., light pulses passing through a fiber-optic cable), or electrical signals transmitted through a wire.

Computer readable program instructions described herein can be downloaded to respective computing/processing devices from a computer readable storage medium or to an external computer or external storage device via a network, for example, the Internet, a local area network, a wide area network and/or a wireless network. The network may comprise copper transmission cables, optical transmission fibers, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers. A network adapter card or network interface in each computing/processing device receives computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium within the respective computing/processing device.

Computer readable program instructions for carrying out operations of the present invention may be assembler instructions, instruction-set-architecture (ISA) instructions, machine instructions, machine dependent instructions, microcode, firmware instructions, state-setting data, or either source code or object code written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++ or the like, and conventional procedural programming languages, such as the “C” programming language or similar programming languages. The computer readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet Service Provider). In some embodiments, electronic circuitry including, for example, programmable logic circuitry, field-programmable gate arrays (FPGA), or programmable logic arrays (PLA) may execute the computer readable program instructions by utilizing state information of the computer readable program instructions to personalize the electronic circuitry, in order to perform aspects of the present invention.

Aspects of the present invention are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer readable program instructions.

These computer readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer readable program instructions may also be stored in a computer readable storage medium that can direct a computer, a programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer readable storage medium having instructions stored therein comprises an article of manufacture including instructions which implement aspects of the function/act specified in the flowchart and/or block diagram block or blocks.

The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable apparatus or other device to produce a computer implemented process, such that the instructions which execute on the computer, other programmable apparatus, or other device implement the functions/acts specified in the flowchart and/or block diagram block or blocks.

The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems that perform the specified functions or acts or carry out combinations of special purpose hardware and computer instructions.

The computational components of FIG. 1, including the host 100 and storage systems 1202 ₁ and 1202 ₂ may be implemented in one or more computer systems, such as the computer system 1802 shown in FIG. 18. Computer system/server 1802 may be described in the general context of computer system executable instructions, such as program modules, being executed by a computer system. Generally, program modules may include routines, programs, objects, components, logic, data structures, and so on that perform particular tasks or implement particular abstract data types. Computer system/server 1802 may be practiced in distributed cloud computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed cloud computing environment, program modules may be located in both local and remote computer system storage media including memory storage devices.

As shown in FIG. 18, the computer system/server 1802 is shown in the form of a general-purpose computing device. The components of computer system/server 1802 may include, but are not limited to, one or more processors or processing units 1804, a system memory 1806, and a bus 1808 that couples various system components including system memory 1806 to processor 1804. Bus 1808 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures include Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MCA) bus, Enhanced ISA (EISA) bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnects (PCI) bus.

Computer system/server 1802 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by computer system/server 1802, and it includes both volatile and non-volatile media, removable and non-removable media.

System memory 1806 can include computer system readable media in the form of volatile memory, such as random access memory (RAM) 1810 and/or cache memory 1812. Computer system/server 1802 may further include other removable/non-removable, volatile/non-volatile computer system storage media. By way of example only, storage system 1813 can be provided for reading from and writing to a non-removable, non-volatile magnetic media (not shown and typically called a “hard drive”). Although not shown, a magnetic disk drive for reading from and writing to a removable, non-volatile magnetic disk (e.g., a “floppy disk”), and an optical disk drive for reading from or writing to a removable, non-volatile optical disk such as a CD-ROM, DVD-ROM or other optical media can be provided. In such instances, each can be connected to bus 1808 by one or more data media interfaces. As will be further depicted and described below, memory 1806 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.

Program/utility 1814, having a set (at least one) of program modules 1816, may be stored in memory 1806 by way of example, and not limitation, as well as an operating system, one or more application programs, other program modules, and program data. Each of the operating system, one or more application programs, other program modules, and program data or some combination thereof, may include an implementation of a networking environment. The components of the computer 1802 may be implemented as program modules 1816 which generally carry out the functions and/or methodologies of embodiments of the invention as described herein. The systems of FIG. 1 may be implemented in one or more computer systems 1802, where if they are implemented in multiple computer systems 1802, then the computer systems may communicate over a network.

Computer system/server 1802 may also communicate with one or more external devices 1818 such as a keyboard, a pointing device, a display 1820, etc.; one or more devices that enable a user to interact with computer system/server 1802; and/or any devices (e.g., network card, modem, etc.) that enable computer system/server 1802 to communicate with one or more other computing devices. Such communication can occur via Input/Output (I/O) interfaces 1822. Still yet, computer system/server 1802 can communicate with one or more networks such as a local area network (LAN), a general wide area network (WAN), and/or a public network (e.g., the Internet) via network adapter 1824. As depicted, network adapter 1824 communicates with the other components of computer system/server 1802 via bus 1808. It should be understood that although not shown, other hardware and/or software components could be used in conjunction with computer system/server 1802. Examples, include, but are not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data archival storage systems, etc.

The terms “an embodiment”, “embodiment”, “embodiments”, “the embodiment”, “the embodiments”, “one or more embodiments”, “some embodiments”, and “one embodiment” mean “one or more (but not all) embodiments of the present invention(s)” unless expressly specified otherwise.

The terms “including”, “comprising”, “having” and variations thereof mean “including but not limited to”, unless expressly specified otherwise.

The enumerated listing of items does not imply that any or all of the items are mutually exclusive, unless expressly specified otherwise.

The terms “a”, “an” and “the” mean “one or more”, unless expressly specified otherwise.

Devices that are in communication with each other need not be in continuous communication with each other, unless expressly specified otherwise. In addition, devices that are in communication with each other may communicate directly or indirectly through one or more intermediaries.

A description of an embodiment with several components in communication with each other does not imply that all such components are required. On the contrary a variety of optional components are described to illustrate the wide variety of possible embodiments of the present invention.

When a single device or article is described herein, it will be readily apparent that more than one device/article (whether or not they cooperate) may be used in place of a single device/article. Similarly, where more than one device or article is described herein (whether or not they cooperate), it will be readily apparent that a single device/article may be used in place of the more than one device or article or a different number of devices/articles may be used instead of the shown number of devices or programs. The functionality and/or the features of a device may be alternatively embodied by one or more other devices which are not explicitly described as having such functionality/features. Thus, other embodiments of the present invention need not include the device itself.

The foregoing description of various embodiments of the invention has been presented for the purposes of illustration and description. It is not intended to be exhaustive or to limit the invention to the precise form disclosed. Many modifications and variations are possible in light of the above teaching. It is intended that the scope of the invention be limited not by this detailed description, but rather by the claims appended hereto. The above specification, examples and data provide a complete description of the manufacture and use of the composition of the invention. Since many embodiments of the invention can be made without departing from the spirit and scope of the invention, the invention resides in the claims herein after appended. 

What is claimed is:
 1. A computer program product for performing a failover from a primary storage system having a primary cache and a primary storage to a secondary storage system having a secondary cache and a secondary storage, the computer program product comprising a computer readable storage medium having computer readable program code executed in the primary and the secondary storage systems to perform operations, the operations comprising: mirroring data from the primary storage system to the secondary storage system; initiating a failover from the primary storage system to the secondary storage system; in response to the failover, for each track indicated in a cache list of tracks in the primary cache, adding, by the primary storage system, a track identifier of the track and track format information indicating a layout of data in the track, indicated in track metadata for the track in the primary storage, to a cache transfer list, wherein the track format information comprises a track format code defined in a primary track format table at the primary storage system and a secondary track format table at the secondary storage system associating track format codes with track format metadata; transferring, by the primary storage system, the cache transfer list to the secondary storage system; staging, by the secondary storage system, a track from the secondary storage into the secondary cache; generating a cache control block for the staged track; determining whether there is track format information for the staged track that was transferred with the cache transfer list to the secondary storage system; including the track format information, transferred with the cache transfer list, for the staged track, in the cache control block for the staged track in response to determining that there is the track format information for the staged track transferred with the cache transfer list; and using, by the secondary storage system after the failover, the track format information for the staged track included in the cache control block for the staged track.
 2. The computer program product of claim 1, wherein prior to the failover while the primary storage system comprises an active storage system to which host Input/Output (I/O) requests are directed, and the primary storage system periodically performs: determining tracks in the primary cache; generating a cache transfer list for the determined tracks including track identifiers and the track format information for the determined tracks; and transferring to the secondary storage system the cache transfer list.
 3. The computer program product of claim 2, wherein the determining the tracks and the generating and the transferring the cache transfer list are performed during periods of low usage at the primary storage system.
 4. The computer program product of claim 2, wherein the cache transfer list generated during the failover by the primary storage system includes track information for tracks added to the primary cache since a most recent cache transfer list was generated and transferred to the secondary storage system.
 5. The computer program product of claim 1, wherein prior to the failover, tracks in the primary storage system are mirrored to the secondary storage system, wherein after the failover read and write requests directed to the tracks in the primary storage system are redirected to the secondary storage system to service from the secondary storage to which tracks from the primary storage have been mirrored.
 6. The computer program product of claim 1, wherein the cache list comprises a primary cache list, wherein the cache transfer list comprises a primary cache transfer list, wherein the operations further comprise: initiating a failback from the secondary storage system to the primary storage system after the failover to the secondary storage system; in response to the failback, for each track indicated in a secondary cache list of tracks in the secondary cache, adding, by the secondary storage system, a track identifier of the track and track format information indicating a layout of data in the track to a secondary cache transfer list; transferring, by the secondary storage system, the secondary cache transfer list to the primary storage system; and using, by the primary storage system, the track format information transferred with the secondary cache transfer list for a track staged into the primary cache from the primary storage having a track identifier in the secondary cache transfer list after the failback.
 7. The computer program product of claim 1, wherein the operations further comprise: maintaining, by the secondary storage system, a demoted track list indicating tracks demoted from the secondary cache for which track format information is maintained; and including track identifiers in the cache transfer list into the demoted track list.
 8. The computer program product of claim 1, wherein the operations performed by the secondary storage system in response to receiving the cache transfer list further comprise: for at least one track indicated in the cache transfer list, generating a demoted track cache control block indicating the track and the track format information for the track in the cache transfer list, and determining whether there is a demoted cache control block for the staged track wherein the track format information is included from the demoted cache control block for the staged track in response to determining that there is the demoted cache control block for the staged track.
 9. The computer program product of claim 1, wherein the operations performed by the secondary storage system in response to receiving the cache transfer list further comprise for each track indicated in the cache transfer list: generating a demoted cache control block indicating the track and the track format information for the track in the cache transfer list; determining an entry in a demoted cache control block directory, having a plurality of entries, based on a track identifier of the track for which the demoted cache control block is generated; and indicating the demoted cache control block in the determined entry in the demoted cache control block directory.
 10. A storage environment, comprising: a primary storage system including a primary storage and a primary cache to cache data from the primary storage; a secondary storage system including a secondary storage and a secondary cache to cache data from the secondary storage; wherein the primary storage system and the secondary storage system perform a failover from the primary storage system to the secondary storage system by performing operations, the operations comprising: mirroring data from the primary storage system to the secondary storage system; initiating a failover from the primary storage system to the secondary storage system; in response to the failover, for each track indicated in a cache list of tracks in the primary cache, adding, by the primary storage system, a track identifier of the track and track format information indicating a layout of data in the track, indicated in track metadata for the track in the primary storage, to a cache transfer list, wherein the track format information comprises a track format code defined in a primary track format table at the primary storage system and a secondary track format table at the secondary storage system associating track format codes with track format metadata; transferring, by the primary storage system, the cache transfer list to the secondary storage system; staging, by the secondary storage system, a track from the secondary storage into the secondary cache; generating a cache control block for the staged track; determining whether there is track format information for the staged track that was transferred with the cache transfer list to the secondary storage system; including the track format information, transferred with the cache transfer list, for the staged track, in the cache control block for the staged track in response to determining that there is the track format information for the staged track transferred with the cache transfer list; and using, by the secondary storage system after the failover, the track format information for the staged track included in the cache control block for the staged track.
 11. The storage environment of claim 10, wherein prior to the failover while the primary storage system comprises an active storage system to which host Input/Output (I/O) requests are directed, the primary storage system periodically performs: determining tracks in the primary cache; generating a cache transfer list for the determined tracks including track identifiers and the track format information for the determined tracks; and transferring to the secondary storage system the cache transfer list.
 12. The storage environment of claim 11, wherein the cache transfer list generated during the failover by the primary storage system includes track information for tracks added to the primary cache since a most recent cache transfer list was generated and transferred to the secondary storage system.
 13. The storage environment of claim 10, wherein the cache list comprises a primary cache list, wherein the cache transfer list comprises a primary cache transfer list, wherein the operations further comprise: initiating a failback from the secondary storage system to the primary storage system after the failover to the secondary storage system; in response to the failback, for each track indicated in a secondary cache list of tracks in the secondary cache, adding, by the secondary storage system, a track identifier of the track and track format information indicating a layout of data in the track to a secondary cache transfer list; transferring, by the secondary storage system, the secondary cache transfer list to the primary storage system; and using, by the primary storage system, the track format information transferred with the secondary cache transfer list for a track staged into the primary cache from the primary storage having a track identifier in the secondary cache transfer list after the failback.
 14. The storage environment of claim 10, wherein the operations performed by the secondary storage system in response to receiving the cache transfer list further comprise for each track indicated in the cache transfer list: generating a demoted cache control block indicating the track and the track format information for the track in the cache transfer list; determining an entry in a demoted cache control block directory, having a plurality of entries, based on a track identifier of the track for which the demoted cache control block is generated; and indicating the demoted cache control block in the determined entry in the demoted cache control block directory.
 15. A method for performing a failover from a primary storage system having a primary cache and a primary storage to a secondary storage system having a secondary cache and a secondary storage, comprising: mirroring data from the primary storage system to the secondary storage system; initiating a failover from the primary storage system to the secondary storage system; in response to the failover, for each track indicated in a cache list of tracks in the primary cache, adding, by the primary storage system, a track identifier of the track and track format information indicating a layout of data in the track, indicated in track metadata for the track in the primary storage, to a cache transfer list, wherein the track format information comprises a track format code defined in a primary track format table at the primary storage system and a secondary track format table at the secondary storage system associating track format codes with track format metadata; transferring, by the primary storage system, the cache transfer list to the secondary storage system; staging, by the secondary storage system, a track from the secondary storage into the secondary cache; generating a cache control block for the staged track; determining whether there is track format information for the staged track that was transferred with the cache transfer list to the secondary storage system; including the track format information, transferred with the cache transfer list, for the staged track, in the cache control block for the staged track in response to determining that there is the track format information for the staged track transferred with the cache transfer list; and using, by the secondary storage system after the failover, the track format information for the staged track included in the cache control block for the staged track.
 16. The method of claim 15, wherein prior to the failover while the primary storage system comprises an active storage system to which host Input/Output (I/O) requests are directed, and further periodically performing: determining tracks in the primary cache; generating a cache transfer list for the determined tracks including track identifiers and the track format information for the determined tracks; and transferring to the secondary storage system the cache transfer list.
 17. The method of claim 16, wherein the cache transfer list generated during the failover by the primary storage system includes track information for tracks added to the primary cache since a most recent cache transfer list was generated and transferred to the secondary storage system.
 18. The method of claim 15, wherein the cache list comprises a primary cache list, wherein the cache transfer list comprises a primary cache transfer list, further comprising: initiating a failback from the secondary storage system to the primary storage system after the failover to the secondary storage system; in response to the failback, for each track indicated in a secondary cache list of tracks in the secondary cache, adding, by the secondary storage system, a track identifier of the track and track format information indicating a layout of data in the track to a secondary cache transfer list; transferring, by the secondary storage system, the secondary cache transfer list to the primary storage system; and using, by the primary storage system, the track format information transferred with the secondary cache transfer list for a track staged into the primary cache from the primary storage having a track identifier in the secondary cache transfer list after the failback.
 19. The method of claim 15, wherein the secondary storage system in response to receiving the cache transfer list further performs for each track indicated in the cache transfer list: generating a demoted cache control block indicating the track and the track format information for the track in the cache transfer list; determining an entry in a demoted cache control block directory, having a plurality of entries, based on a track identifier of the track for which the demoted cache control block is generated; and indicating the demoted cache control block in the determined entry in the demoted cache control block directory. 